home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17770 < prev    next >
Encoding:
Text File  |  1996-08-05  |  4.8 KB  |  154 lines

  1. Path: ix.netcom.com!news
  2. From: lewkbj@ix.netcom.com (leonel wizel )
  3. Newsgroups: comp.lang.c++
  4. Subject: I need help with homework
  5. Date: 17 Apr 1996 03:11:28 GMT
  6. Organization: Netcom
  7. Message-ID: <4l1nh0$oed@dfw-ixnews1.ix.netcom.com>
  8. NNTP-Posting-Host: ix-nyc9-12.ix.netcom.com
  9. X-NETCOM-Date: Tue Apr 16 10:11:28 PM CDT 1996
  10.  
  11.  
  12.     Please I need help to complete this file:   this file suppose to
  13. increment the object time by one second to the next hour, to the
  14. next minute to the next day:
  15.  
  16. I need some help please:
  17.  
  18.  
  19. the program suppose to modify to include a tick member function
  20. that increments the time stored in the Time object by one second.  The
  21. time object should always remain in a consistent state.  The driver
  22. program that tests the tick member function in a loop that prints the
  23. time in standard format during each iteration of the loop to illustrate
  24. that the tick member functions workds correctly.  
  25.  
  26.     Incrementing into the next minute.
  27.     Incrementing into the next hour.
  28.     incrementing into the next day(i.e., 11:59:59 PM to 12:00:00 AM).
  29.  
  30.  
  31.     Create a modified class Time combined it with another class
  32. called "DateAndtime".  Modify the tick function  to call the nextDay
  33. function if the time is incremented into the next day.  Modify function
  34. printStandard and PrintMilitary to output thee date in addtion to the
  35. time.  Write a driver program to test the new class "DateAndTime". 
  36. specifically test incrementing the time into the next day.
  37.  
  38.     Modify the Date class to perform error checking on the initializer
  39. values for data members month, day and year.  Also provide a member
  40. function NextDay to increment the day by one.  The Date object should
  41. always remain in a consistent state.  Write a driver program that tests
  42. the nextDay function in a loop that prints the date during each
  43. iteration of the loop to illustrate that the Nextday function works
  44. correctly.  I have to make sure to test the following cases:
  45.  
  46.     Incrementing into the next month.
  47.     incrementing into the next year.
  48.  
  49.  
  50. Modify the set functions in the previous program to return appropiate
  51. error values if an attempt is made to set a data member of an object of
  52. class Time to an invalid values.
  53.  
  54. thank you for your cooperatiFrom: lewkbj@ix.netcom.com (leonel wizel )
  55. Newsgroups: comp.lang.c++
  56. Subject: I need help with homework
  57.  
  58.  
  59.     Please I need help to complete this file:   this file suppose to
  60. increment the object time by one second to the next hour, to the
  61. next minute to the next day:
  62.  
  63. I need some help please:
  64.  
  65.  
  66. the program suppose to modify to include a tick member function
  67. that increments the time stored in the Time object by one second.  The
  68. time object should always remain in a consistent state.  The driver
  69. program that tests the tick member function in a loop that prints the
  70. time in standard format during each iteration of the loop to illustrate
  71. that the tick member functions workds correctly.  
  72.  
  73.     Incrementing into the next minute.
  74.     Incrementing into the next hour.
  75.     incrementing into the next day(i.e., 11:59:59 PM to 12:00:00 AM).
  76.  
  77.  
  78.     Create a modified class Time combined it with another class
  79. called "DateAndtime".  Modify the tick function  to call the nextDay
  80. function if the time is incremented into the next day.  Modify function
  81. printStandard and PrintMilitary to output thee date in addtion to the
  82. time.  Write a driver program to test the new class "DateAndTime". 
  83. specifically test incrementing the time into the next day.
  84.  
  85.     Modify the Date class to perform error checking on the initializer
  86. values for data members month, day and year.  Also provide a member
  87. function NextDay to increment the day by one.  The Date object should
  88. always remain in a consistent state.  Write a driver program that tests
  89. the nextDay function in a loop that prints the date during each
  90. iteration of the loop to illustrate that the Nextday function works
  91. correctly.  I have to make sure to test the following cases:
  92.  
  93.     Incrementing into the next month.
  94.     incrementing into the next year.
  95.  
  96.  
  97. Modify the set functions in the previous program to return appropiate
  98. error values if an attempt is made to set a data member of an object of
  99. class Time to an invalid values.
  100.  
  101. thank you for your cooperatide <iostream.h>
  102. #include "time3.h"
  103. #include "time3.cpp"
  104.  
  105.  
  106. main()
  107. {
  108.   Time t;
  109.  
  110.   t.setTime(23, 59, 59);
  111.  
  112.   for(long int i = 1; i <= 2; i++)
  113.     {
  114.         cout << endl << endl;
  115.         cout << " Hour " << t.getHour()
  116.               << " Minute " << t.getMinute()
  117.               << " Second " << t.getSecond();
  118.  
  119.         cout <<"the initial time before incrementing is: " << endl
  120. << endl;
  121.  
  122.         t.printStandard();
  123.         cout << endl;
  124.         t.printMilitary();
  125.  
  126.         t.tick_increment();
  127.         cout << " Hour " << t.getHour()
  128.               << " Minute " << t.getMinute()
  129.               << " Second " << t.getSecond()
  130.               <<" the time after incrementing is: " << endl;
  131.  
  132.         t.printStandard();
  133.         cout << endl;
  134.         t.printMilitary();
  135.  
  136.     }
  137.  
  138.  
  139.  
  140.     return 0;
  141. }
  142.  
  143.     thank you all of you for your cooperation and help.
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.